<div class="content">
<h2>Hausbar</h2>
<?php print $this->notice($this->message); ?>
<p>Wenn du alle deine vorhandenen Zutaten angibst, 
kann der cocktailberater ermitteln, welche Rezepte du damit mixen kannst.</p>
<form id="ingredient2bar" name="ingredient2bar" method="post"
	action="<?php echo $this->url(array('module'=>'website','controller'=>'portal','action'=>'meine-hausbar-mixen')); ?>?format=<?php print $this->format; ?>"><?php 
	$ingredientCategories=Website_Model_IngredientCategory::getIngredientCategories();
	foreach($ingredientCategories as $ingredientCategory){
		?>
<p class="pink clear" 
style="margin-bottom: 0.2em; font-weight: normal; margin-top: 1em;">Zutaten
 der Kategorie &quot;<?php print $ingredientCategory->name; ?>&quot; <?php if($this->format=='html') { ?><span 
 class="link pointer category_<?php print $ingredientCategory->id; ?>_select"
 onclick="dojo.query('.category_<?php print $ingredientCategory->id; ?>').forEach(function(e){ e.checked=true; }); dojo.query('.category_<?php print $ingredientCategory->id; ?>_select').toggleClass('hide');">(alles auswählen)</span><span 
 class="link pointer category_<?php print $ingredientCategory->id; ?>_select hide" id="category_<?php print $ingredientCategory->id; ?>_unselect"
 onclick="dojo.query('.category_<?php print $ingredientCategory->id; ?>').forEach(function(e){ e.checked=false; }); dojo.query('.category_<?php print $ingredientCategory->id; ?>_select').toggleClass('hide');">(alles abwählen)</span><?php } ?></p>
<ul class="clear no-bullet two_column" style="margin-top: 0.5em; margin-left: 0;">
<?php
$ingredients=Website_Model_IngredientCategory::getIngredientsByCategory($ingredientCategory->id,true);
foreach($ingredients as $ingredient){
	if ($this->bar->hasIngredient(Website_Model_CbFactory::factory('Website_Model_Ingredient',$ingredient->id))) {
		$checked='checked="checked"';
	} else {
		$checked='';
	}
	print stripslashes("<li style=\"margin-bottom: 0.4em; -webkit-column-break-inside: avoid; -webkit-break-inside:avoid-column; break-inside: avoid-column;\">".
			"<input type=\"checkbox\" name=\"ingredient2bar[]\" class=\"category_{$ingredientCategory->id}\" ". 
			"value=\"$ingredient->id\" $checked id=\"ingredient_{$ingredientCategory->id}_{$ingredient->id}\" /> ".
			"<label style=\"-webkit-column-break-inside: avoid; -webkit-break-inside:avoid-column; break-inside: avoid-column; \" for=\"ingredient_{$ingredientCategory->id}_{$ingredient->id}\">$ingredient->name</label>".
			"</li>");
}
?>
</ul>
<hr style="visibility: hidden; width: 50%;" />
<?php
	}
	?> <input style="margin-top: 1em; margin-bottom: 1em;" class="right pink" type="submit"
	value="Was kann ich damit mixen?" name="submit_ingredient2bar" /> <input
	style="margin-top: 1em; margin-bottom: 1em;" type="submit" class="grey left"
	value="zurücksetzen" name="reset_ingredient2bar" /></form>
</div>
